-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load chats when handling browser notifications. Fix initial sign in bug. #339
Conversation
*/ | ||
function fetchChatReports() { | ||
return queueRequest('Get', {returnValueList: 'chatList'}) | ||
.then(({chatList}) => fetchChatReportsByIDs(String(chatList).split(','))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to cast this to a string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because rvl=chatList
returns an int when there's only one chat and calling .split()
on a Number
doesn't work. Can probably handle this a different way, but imagining that we'll change the way we fetch chats in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's good to know! That would be another good thing to add as a comment in the code. It could bite someone.
throw new Error('report does not exist in the store, so ignoring new comments'); | ||
} | ||
|
||
if (!ionReportID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a comment here to explain how it gets into this situation?
Updated |
Fixes:
#334
#316
Tests:
Testing first sign in
localStorage
Testing a new chat report notification will add the chat to your LHN if it doesn't exist
Apply this diff or run the app in production mode
API.createChatReport({emailList:'address1,address2'})